{
 "cells": [
  {
   "cell_type": "markdown",
   "source": [
    "## 2.2 索引对象"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "### 1.Index对象"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:33.524823Z",
     "end_time": "2024-05-08T19:14:35.108606Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "pandas.core.indexes.range.RangeIndex"
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "\n",
    "s = pd.Series(np.random.randn(5))\n",
    "type(s.index)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "outputs": [
    {
     "data": {
      "text/plain": "RangeIndex(start=0, stop=5, step=1)"
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.index"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.113273Z",
     "end_time": "2024-05-08T19:14:35.172026Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "outputs": [
    {
     "data": {
      "text/plain": "0"
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.index[0]"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.136182Z",
     "end_time": "2024-05-08T19:14:35.172026Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "outputs": [
    {
     "data": {
      "text/plain": "RangeIndex(start=0, stop=3, step=1)"
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.index[:3]"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.156131Z",
     "end_time": "2024-05-08T19:14:35.172026Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "outputs": [
    {
     "data": {
      "text/plain": "Index([4], dtype='int64')"
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.index[s.index > 3]"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.172026Z",
     "end_time": "2024-05-08T19:14:35.187661Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "outputs": [
    {
     "data": {
      "text/plain": "a    1.171858\nb   -1.455159\nc    0.844315\nd   -0.267004\ne    1.662894\ndtype: float64"
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.index = ['a', 'b', 'c', 'd', 'e']\n",
    "s"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.187661Z",
     "end_time": "2024-05-08T19:14:35.269117Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "outputs": [
    {
     "data": {
      "text/plain": "physics    100\npython      90\nmath        80\nenglish     70\ndtype: int64"
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ind = pd.Index(['physics', 'python', 'math', 'english'])\n",
    "s = pd.Series([100, 90, 80, 70], index=ind)\n",
    "s"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.214831Z",
     "end_time": "2024-05-08T19:14:35.277771Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "outputs": [
    {
     "data": {
      "text/plain": "         soochow  tsinghua\nphysics      100        98\npython        90        34\nmath          80        83\nenglish       70        49",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>soochow</th>\n      <th>tsinghua</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>physics</th>\n      <td>100</td>\n      <td>98</td>\n    </tr>\n    <tr>\n      <th>python</th>\n      <td>90</td>\n      <td>34</td>\n    </tr>\n    <tr>\n      <th>math</th>\n      <td>80</td>\n      <td>83</td>\n    </tr>\n    <tr>\n      <th>english</th>\n      <td>70</td>\n      <td>49</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d = pd.DataFrame({'soochow': s, 'tsinghua': [98, 34, 83, 49]}, index=ind)\n",
    "d"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.247179Z",
     "end_time": "2024-05-08T19:14:35.277771Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "outputs": [
    {
     "data": {
      "text/plain": "Index([3, 4, 7, 8], dtype='int64')"
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "inda = pd.Index([2, 4, 6, 8])\n",
    "indb = pd.Index([3, 4, 7, 8])\n",
    "inda | indb"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.274364Z",
     "end_time": "2024-05-08T19:14:35.310121Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "outputs": [
    {
     "data": {
      "text/plain": "Index([2, 4, 6, 8], dtype='int64')"
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "inda & indb"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.297840Z",
     "end_time": "2024-05-08T19:14:35.373010Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "outputs": [
    {
     "data": {
      "text/plain": "Index([1, 0, 1, 0], dtype='int64')"
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "inda ^ indb"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.303359Z",
     "end_time": "2024-05-08T19:14:35.404020Z"
    }
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "### 2.MultiIndex对象"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "outputs": [
    {
     "data": {
      "text/plain": "MultiIndex([('China',  'Beijing'),\n            ('China', 'HongKong'),\n            (  'USA',  'Chicago'),\n            (  'USA',  'NewYork'),\n            (  'USA',  'SanFran')],\n           )"
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cities_index = [(\"China\", \"Beijing\"), (\"China\", \"HongKong\"), (\"USA\", \"Chicago\"), (\"USA\", \"NewYork\"), (\"USA\", \"SanFran\")]\n",
    "cities = pd.MultiIndex.from_tuples(cities_index)\n",
    "cities"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.330466Z",
     "end_time": "2024-05-08T19:14:35.467220Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "outputs": [
    {
     "data": {
      "text/plain": "MultiIndex([('China',  'Beijing'),\n            ('China', 'HongKong'),\n            (  'USA',  'Chicago'),\n            (  'USA',  'NewYork'),\n            (  'USA',  'SanFran')],\n           )"
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "city_arr = np.array([[\"China\", \"China\", \"USA\", \"USA\", \"USA\"], [\"Beijing\", \"HongKong\", \"Chicago\", \"NewYork\", \"SanFran\"]])\n",
    "cities2 = pd.MultiIndex.from_arrays(city_arr)\n",
    "cities2"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.351029Z",
     "end_time": "2024-05-08T19:14:35.467220Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "outputs": [
    {
     "data": {
      "text/plain": "MultiIndex([('a', 100),\n            ('a', 200),\n            ('b', 100),\n            ('b', 200)],\n           )"
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.MultiIndex.from_product([['a', 'b'], [100, 200]])"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.380956Z",
     "end_time": "2024-05-08T19:14:35.493669Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "outputs": [
    {
     "data": {
      "text/plain": "MultiIndex([('a', 100),\n            ('a', 200),\n            ('b', 100),\n            ('b', 200)],\n           )"
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.MultiIndex.from_arrays([['a', 'a', 'b', 'b'], [100, 200, 100, 200]])"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.396262Z",
     "end_time": "2024-05-08T19:14:35.540922Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "outputs": [
    {
     "data": {
      "text/plain": "MultiIndex([('a', 100),\n            ('a', 200),\n            ('b', 100),\n            ('b', 200)],\n           )"
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Index([(\"a\", 100), (\"a\", 200), (\"b\", 100), (\"b\", 200)])"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.420222Z",
     "end_time": "2024-05-08T19:14:35.567667Z"
    }
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "### 3.在数据中使用MultiIndex对象"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "outputs": [
    {
     "data": {
      "text/plain": "shanghai   2015    25300\n           2016    27466\nbeijing    2015    23000\n           2016    24899\nguangzhou  2015    18100\n           2016    19611\ndtype: int64"
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gdp_index = [(\"shanghai\", 2015), (\"shanghai\", 2016), (\"beijing\", 2015), (\"beijing\", 2016), (\"guangzhou\", 2015),\n",
    "             (\"guangzhou\", 2016)]\n",
    "gdp_mind = pd.MultiIndex.from_tuples(gdp_index)\n",
    "gdp3 = pd.Series([25300, 27466, 23000, 24899, 18100, 19611], index=gdp_mind)\n",
    "gdp3"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.445719Z",
     "end_time": "2024-05-08T19:14:35.567667Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "outputs": [
    {
     "data": {
      "text/plain": "            2015   2016\nbeijing    23000  24899\nguangzhou  18100  19611\nshanghai   25300  27466",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>2015</th>\n      <th>2016</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>beijing</th>\n      <td>23000</td>\n      <td>24899</td>\n    </tr>\n    <tr>\n      <th>guangzhou</th>\n      <td>18100</td>\n      <td>19611</td>\n    </tr>\n    <tr>\n      <th>shanghai</th>\n      <td>25300</td>\n      <td>27466</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gdp3.unstack()"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.465678Z",
     "end_time": "2024-05-08T19:14:35.655210Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "outputs": [
    {
     "data": {
      "text/plain": "beijing    2015    23000\n           2016    24899\nguangzhou  2015    18100\n           2016    19611\nshanghai   2015    25300\n           2016    27466\ndtype: int64"
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gdp3.unstack().stack()"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.495305Z",
     "end_time": "2024-05-08T19:14:35.655210Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "outputs": [
    {
     "data": {
      "text/plain": "                  GDP  Price\nshanghai  2015  25300  32260\n          2016  27466  31670\nbeijing   2015  23000  30972\n          2016  24899  32131\nguangzhou 2015  18100  16153\n          2016  19611  18484",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th></th>\n      <th>GDP</th>\n      <th>Price</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th rowspan=\"2\" valign=\"top\">shanghai</th>\n      <th>2015</th>\n      <td>25300</td>\n      <td>32260</td>\n    </tr>\n    <tr>\n      <th>2016</th>\n      <td>27466</td>\n      <td>31670</td>\n    </tr>\n    <tr>\n      <th rowspan=\"2\" valign=\"top\">beijing</th>\n      <th>2015</th>\n      <td>23000</td>\n      <td>30972</td>\n    </tr>\n    <tr>\n      <th>2016</th>\n      <td>24899</td>\n      <td>32131</td>\n    </tr>\n    <tr>\n      <th rowspan=\"2\" valign=\"top\">guangzhou</th>\n      <th>2015</th>\n      <td>18100</td>\n      <td>16153</td>\n    </tr>\n    <tr>\n      <th>2016</th>\n      <td>19611</td>\n      <td>18484</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "price = [32260, 31670, 30972, 32131, 16153, 18484]\n",
    "gdp_house = pd.DataFrame({\"GDP\": gdp3, \"Price\": price})\n",
    "gdp_house"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.523845Z",
     "end_time": "2024-05-08T19:14:35.655210Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "outputs": [
    {
     "data": {
      "text/plain": "MultiIndex([( 'shanghai', 2015),\n            ( 'shanghai', 2016),\n            (  'beijing', 2015),\n            (  'beijing', 2016),\n            ('guangzhou', 2015),\n            ('guangzhou', 2016)],\n           )"
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gdp_house.index"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.546076Z",
     "end_time": "2024-05-08T19:14:35.655210Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "outputs": [
    {
     "data": {
      "text/plain": "shanghai   2015    25300\n           2016    27466\nbeijing    2015    23000\n           2016    24899\nguangzhou  2015    18100\n           2016    19611\ndtype: int64"
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gdp4 = pd.Series(\n",
    "    {(\"shanghai\", 2015): 25300, (\"shanghai\", 2016): 27466, (\"beijing\", 2015): 23000, (\"beijing\", 2016): 24899,\n",
    "     (\"guangzhou\", 2015): 18100, (\"guangzhou\", 2016): 19611})\n",
    "gdp4"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.571659Z",
     "end_time": "2024-05-08T19:14:35.655210Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "outputs": [
    {
     "data": {
      "text/plain": "                  GDP  Price\nshanghai  2015  25300  32260\n          2016  27466  31670\nbeijing   2015  23000  30972\n          2016  24899  32131\nguangzhou 2015  18100  16153\n          2016  19611  18484",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th></th>\n      <th>GDP</th>\n      <th>Price</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th rowspan=\"2\" valign=\"top\">shanghai</th>\n      <th>2015</th>\n      <td>25300</td>\n      <td>32260</td>\n    </tr>\n    <tr>\n      <th>2016</th>\n      <td>27466</td>\n      <td>31670</td>\n    </tr>\n    <tr>\n      <th rowspan=\"2\" valign=\"top\">beijing</th>\n      <th>2015</th>\n      <td>23000</td>\n      <td>30972</td>\n    </tr>\n    <tr>\n      <th>2016</th>\n      <td>24899</td>\n      <td>32131</td>\n    </tr>\n    <tr>\n      <th rowspan=\"2\" valign=\"top\">guangzhou</th>\n      <th>2015</th>\n      <td>18100</td>\n      <td>16153</td>\n    </tr>\n    <tr>\n      <th>2016</th>\n      <td>19611</td>\n      <td>18484</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = np.array([[25300, 32260], [27466, 31670], [23000, 30972], [24899, 32131], [18100, 16153], [19611, 18484]])\n",
    "gdp_house2 = pd.DataFrame(a, index=[[\"shanghai\", \"shanghai\", \"beijing\", \"beijing\", \"guangzhou\", \"guangzhou\"],\n",
    "                                    [2015, 2016, 2015, 2016, 2015, 2016]],\n",
    "                          columns=[\"GDP\", \"Price\"])\n",
    "gdp_house2"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.599655Z",
     "end_time": "2024-05-08T19:14:35.655210Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "outputs": [
    {
     "data": {
      "text/plain": "                  GDP  Price\nshanghai  2015  25300  32260\n          2016  27466  31670\nbeijing   2015  23000  30972\n          2016  24899  32131\nguangzhou 2015  18100  16153\n          2016  19611  18484",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th></th>\n      <th>GDP</th>\n      <th>Price</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th rowspan=\"2\" valign=\"top\">shanghai</th>\n      <th>2015</th>\n      <td>25300</td>\n      <td>32260</td>\n    </tr>\n    <tr>\n      <th>2016</th>\n      <td>27466</td>\n      <td>31670</td>\n    </tr>\n    <tr>\n      <th rowspan=\"2\" valign=\"top\">beijing</th>\n      <th>2015</th>\n      <td>23000</td>\n      <td>30972</td>\n    </tr>\n    <tr>\n      <th>2016</th>\n      <td>24899</td>\n      <td>32131</td>\n    </tr>\n    <tr>\n      <th rowspan=\"2\" valign=\"top\">guangzhou</th>\n      <th>2015</th>\n      <td>18100</td>\n      <td>16153</td>\n    </tr>\n    <tr>\n      <th>2016</th>\n      <td>19611</td>\n      <td>18484</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gh_mind = pd.MultiIndex.from_arrays(\n",
    "    [[\"shanghai\", \"shanghai\", \"beijing\", \"beijing\", \"guangzhou\", \"guangzhou\"], [2015, 2016, 2015, 2016, 2015, 2016]])\n",
    "pd.DataFrame(a, index=gh_mind, columns=['GDP', 'Price'])"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.612140Z",
     "end_time": "2024-05-08T19:14:35.655210Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "start_time": "2024-05-08T19:14:35.622692Z",
     "end_time": "2024-05-08T19:14:35.708486Z"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
